<?php if ( $_SESSION['logged_in'] == FALSE ) redirect (base_url ()); ?>

<div id="content">
<?php
      ListUsers($users); 
      echo '</div> <!-- content -->';

function ListUsers($userlist) {
    // displays Users entries in a table with the first column being a hyperlink to edit the entry    
    echo "<div class='form1'>";
    echo '<table width="90%" border="0" cellspacing="0" cellpadding="0" id="wide-content" overflow="auto">';
    echo '
        <thead id="gridheader">
        <th align="left" bgcolor="#9DE3F0" width="30%">Name</th>
        <th align="left" bgcolor="#9DE3F0" width="30%">Email</th>
        <th align="left" bgcolor="#9DE3F0" width="20%">Mobile</th>
        </thead> ';
   
    foreach($userlist as $value)
    {
   	echo "<tr overflow='auto'><td id='gridselect' ><a href='edituser/";
   	echo $value['_id']."'>" ;
   	echo $value['Name']  . "</a></td> "; 
   	echo "<td  id='griddata'>" . $value['username'] ."</td>";
        echo "<td  id='griddata'>" . $value['mobile'] ."</td>";
        echo "</tr>";
    }
    echo "</table> ";
    echo "</div>";
}
?>